<template>
    <div>
        <van-nav-bar title="搜索" left-text="返回" left-arrow @click-left="()=>{$router.push('/a/b')}" />
        <van-search v-model="value" shape="round" background="#4fc08d" placeholder="请输入搜索关键词" />
        <div v-for="item in wch">
<van-cell-group >
    <router-link :to="'/xq/'+item.goods_id">
  <van-cell :title="item.goods_name" />
    </router-link>


</van-cell-group>
        </div>
        
    </div>
</template>

<script setup>
import {qsearchApi} from '@/api/api'
import {ref, watch} from 'vue'
import _ from 'lodash'


let wch=ref([])
let value=ref('')
watch(value,
_.debounce((val)=>{
qsearchApi(val).then(res=>{
    console.log(res)
wch.value=res.data.message
})
},3000)
)

</script>

<style lang="scss" scoped></style>